import type { App } from "vue";

import { hasPerm } from "./permission";
import debounce from "./antiVibrationThrottling/debounce";
import throttle from "./antiVibrationThrottling/throttle";
import preventReClick from "./preventReClick/index";
import scrollLoad from "./scrollLoad/index";
// 全局注册 directive
export function setupDirective(app: App<Element>) {
  // 所有的指令使用都是 v-xxx 的形式
  app.directive("hasPerm", hasPerm);
  app.directive("throttle", throttle);
  app.directive("debounce", debounce);
  app.directive("preventReClick", preventReClick);
  app.directive("scrollLoad", scrollLoad);
}
